﻿import com.dmotiko.chabeli.*
import com.dmotiko.general.*
import mx.transitions.easing.None;
import mx.transitions.easing.Regular;
import mx.transitions.Tween;
import mx.utils.Delegate;

class ChabeliProductListInvert
extends ChabeliProductList {
	
	private function ChabeliProductListInvert() {
		super();
	}
		
	private function moveBandas():Void {
		
		var nCenter:Number = nSpaceX /2;
		var root = this;
		var bLocked:Boolean = false;
		
		this.onMouseMove = function() {
			bLocked = _ymouse > 0 && _ymouse < this._height;
			//nVelocity = (_xmouse - nCenter) / 10;
			//nVelocity = Math.abs(nVelocity);
		}
		
		for (var i:Number = 0; i < aPhotos.length; i++) {
			var clip = aPhotos[i];
			clip.partner = findPartner(clip);
			if (i == aPhotos.length - 1 ) {
				clip.guide = true;
			}
			clip.onEnterFrame = function() {
				if ( this._x > Stage.width + 50 ) {
					this.guide = false;
					root.findNextGuide(this).guide = true;
					//this._x = root.getNewX() - this._width - 2;
					this._x = this.partner._x - this._width - 2;
					//root.registerTween( this._name + "Fade", new Tween( this, "_alpha", Regular.easeOut, this._alpha, 0, 0.3, true), false, true);
				}
				if( this.guide) {
					if ( bLocked) this._x += 3;
					else this._x += root.nVelocity;
				} else {
					this._x = this.partner._x - this._width - 2;
				}
			}
		}
	}
	
}